<!DOCTYPE html>
<html lang="zh">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>山东理工大学教学设施管理系统</title>
        <link href="http://qrserver.qiniudn.com/2.3.0-bootstrap-combined.min.css" rel="stylesheet">
        <script src="http://qrserver.qiniudn.com/1.10.2-jquery.min.js"></script>
        <script src="http://qrserver.qiniudn.com/3.0.3-bootstrap.min.js"></script>
    </head>

    <body>
        <div class="container-fluid">
            <div class="navbar navbar-inverse">
                <div class="navbar-inner">
                    <a class="btn btn-navbar" data-target=".navbar-responsive-collapse" data-toggle="collapse"> </a>
                    <a class="brand" href="{% url 'index' %}">SDUT Devices</a>
                    <div class="nav-collapse collapse navbar-responsive-collapse">
                        <ul class="nav" >
                            <li><a href="{% url 'index' %}">主页</a></li>
                            <li><a href="{% url 'devices:search' %}">设备查询</a></li>
                            <li class="active"><a href="{% url 'maintain:search' %}">维修记录</a></li>
                            <li><a href="{% url 'devices:QRcode' %}">获取二维码</a></li>
                        </ul>
                    </div>
                </div>
            </div>

            <div class="row-fluid">
                <div class="span8">
                    <form method="post" accept-charset="utf-8">
                        <div class="control-group" style="float:left; margin-right:20px;">
                            <label class="control-label" for="inputNum">资产编号：</label>
                            <input id="inputNum" type="text" name="num" />
                        </div>
                        <div class="control-group" style="float:left; margin-right:20px;">
                            <label class="control-label" for="inputName">名 称：</label>
                            <input id="inputName" type="text" name="name" />
                        </div>
                        <div class="control-group" style="float:left; margin-right:20px;">
                            <label class="control-label" for="inputPlace">存放地点：</label>
                            <input id="inputPlace" type="text" name="location" />
                        </div>
                        <div class="control-group">
                            <div class="controls">
                                <br />
                                <button type="submit" class="btn btn-large btn-primary" style="height:37px;"><strong>搜索</strong></button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="span4">
                    <div class="alert">
                        <button type="button" class="close" data-dismiss="alert">×</button>
                        <h4>提示:</h4>{{ message }}
                    </div>
                </div>
            </div>
            <br />
            <div class="row-fluid">
                <div class="span12">
                    <div class="accordion" id="accordion-100000">
                        {% for device in result %}
                            <div class="accordion-group">
                                <div class="accordion-heading">
                                    <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion-100000" href="#accordion-element-0">
                                        <strong>编号：{{ device.0 }}</strong> {{ device.1 }}
                                    </a>
                                </div>
                                <div id="accordion-element-0"
                                     {% if forloop.counter == 1 %}
                                     class="accordion-body in collapse"
                                     {% else %}
                                     class="accordion-body collapse"
                                     {% endif %}
                                >
                                    <div class="accordion-inner">
                                        {% for maintain in maintain %}
                                            <p>
                                                {{ maintain.malfunction }}（{{ maintain.date }}）<br />
                                                {{ maintain.solution }}
                                            </p>
                                        {% endfor %}
                                    </div>
                                </div>
                            </div>
                        {% endfor %}
                    </div>
                </div>
            </div>
            <div class="row-fluid">
                <div class="span12">
                    <div class="pagination">
                        <ul>
                            <li><a href="#">上一页</a></li>
                            <li><a href="#">1</a></li>
                            <li><a href="#">下一页</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </body>
</html>
